package poketrade;


import java.io.IOException;
import java.util.List;

import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import poketrade.entities.PendingOffer;
import poketrade.managers.DealManager;

/**
 * Servlet implementation class AnnonceDisplayer
 */
@WebServlet("/AnnonceDisplayer")
public class AnnonceDisplayer extends BaseHttpServlet {
	private static final long serialVersionUID = 1L;
	
	@EJB
	private DealManager mgr;
       
	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		List<PendingOffer> offres = mgr.getNonConcludedOffers();
		request.setAttribute("offres", offres);
		forward(request, response, "/annoncexmllister.jsp");
	}


}
